package discov

type Conf struct {
	Discover    string `json:"discover" mapstructure:"Discover"`
	Host        string `json:"host" mapstructure:"Host"`
	ServiceName string `json:"serviceName" mapstructure:"ServiceName"`
	Debug       bool   `json:"debug"  mapstructure:"Debug"`
	Proxy       string `json:"proxy" mapstructure:"Proxy"`
}

func (c Conf) valid() bool {
	if c.Discover != "direct" && c.Discover != "consul" {
		return false
	}
	if c.Discover == "direct" {
		if len(c.Host) == 0 {
			return false
		}
	}
	if c.Discover == "direct" {
		if len(c.Host) == 0 {
			return false
		}
	}
	return true
}
